package com.hyts.classcode.enhance.bytebuddy.filter;

import java.lang.reflect.Method;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.enhance.bytebuddy.filter
 * author:Libo/Alex
 * create-date:2019-06-30 02:04
 * copyright:libo-hyts-github
 * email:libo2dev@aliyun.com
 * description:此类主要用于:
 */
public interface ExecuteInterceptor<T> {

    /**
     * 执行操作之前
     * @param targetSubject
     * @param params
     * @param method
     * @return
     */
    Object before(Object targetSubject, Object[] params, Method method,T extenseObj);

    /**
     * 执行操作之后
     * @param targetSubject
     * @param params
     * @param method
     * @param result
     * @return
     */
    Object after(Object targetSubject,Object[] params,Method method,Object result,T extenseObj);


    /**
     * 操作异常
     * @param throwable
     * @param extenseObj
     * @return
     */
    void throwError(Throwable throwable,T extenseObj);
}
